﻿@using Whoever.Framework.Enum;

@model EditorialProyectos.Website.Models.RegisterViewModel

<div data-bind="with: viewModel.Register">
    @using (Html.BeginForm("Register", "Account", FormMethod.Post, new { id = "signup", @data_bind = "submit: viewModel.AttemptSignup" }))
    {
        @Html.AntiForgeryToken();

        <div class="form-group">
            @Html.LocalizedLabelFor(Model => Model.Email)
            @Html.KOLocalizedHelpFor(Model => Model.Email, MessageType.Warning, "FailedSubmit")
            @Html.KOTextBoxFor(Model => Model.Email)
        </div>
        <div class="form-group">
            @Html.LocalizedLabelFor(Model => Model.Password)
            @Html.KOLocalizedHelpFor(Model => Model.Password, MessageType.Warning, "FailedSubmit")
            @Html.KOTextBoxFor(Model => Model.Password)
        </div>
        <div class="form-group">
            @Html.LocalizedLabelFor(Model => Model.ConfirmPassword)
            @Html.KOLocalizedHelpFor(Model => Model.ConfirmPassword, MessageType.Warning, "FailedSubmit")
            @Html.KOTextBoxFor(Model => Model.ConfirmPassword)
        </div>
        <div class="form-group">
            @Html.LocalizedLabelFor(Model => Model.Name)
            @Html.KOLocalizedHelpFor(Model => Model.Name, MessageType.Warning, "FailedSubmit")
            @Html.KOTextBoxFor(Model => Model.Name)
        </div>
        <div class="form-group">
            @Html.LocalizedLabelFor(Model => Model.Surname)
            @Html.KOLocalizedHelpFor(Model => Model.Surname, MessageType.Warning, "FailedSubmit")
            @Html.KOTextBoxFor(Model => Model.Surname)
        </div>
    
        <button data-bind="click: viewModel.AttemptSignup" type="submit" class="btn btn-action btn-full-width">@Html.LocalizedAction("Signup")</button>
    }
</div>
